<!DOCTYPE html>
<html>
<head>
<title>linux-and-python.md</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">

<style>
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: "";
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table > thead > tr > th {
	text-align: left;
	border-bottom: 1px solid;
}

table > thead > tr > th,
table > thead > tr > td,
table > tbody > tr > th,
table > tbody > tr > td {
	padding: 5px 10px;
}

table > tbody > tr + tr > td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code > div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table > thead > tr > th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table > thead > tr > th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table > tbody > tr + tr > td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table > tbody > tr + tr > td {
	border-color: rgba(255, 255, 255, 0.18);
}

</style>

<style>
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
</style>

<style>
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "Meiryo";
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) > code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use <div class="page"/> to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

</style>

<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>
</head>
<body>
  <script>
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  </script>
<h1 id="linux-and-python">linux-and-python</h1>
<h2 id="0-%E9%9C%80%E8%A6%81%E7%94%A8%E5%88%B0%E7%9A%84%E5%B7%A5%E5%85%B7">0. 需要用到的工具</h2>
<h3 id="01-%E6%A2%AF%E5%AD%90">0.1 梯子</h3>
<p>glados</p>
<blockquote>
<p>glados是收费梯子。刚开始会免费送 24 小时（edu 邮箱注册送 365 天），并且只要每天签到就多送一天。因此 github 上有人做了定时自动签到的脚本。相当于可以一直免费用</p>
</blockquote>
<ul>
<li>配置方法：见<a href="./GLaDOS-auto-signin-coding-picture-bed.html">另一篇文章</a></li>
<li>使用方法：
<ul>
<li>windows、安卓、mac 按照 <a href="https://glados.best/">glados 官网</a>配置</li>
<li>linux 需要 clash 和 chashup（clashup <strong><u>仅在</u></strong> manjaro 发行版可直接通过自带的包管理器安装，其他发行版需要自己编译。参考<a href="https://github.com/ysl2/my-notes/blob/master/linux/distribution/manjaro/03-china-source-and-download-settings.md#%E8%AE%BE%E7%BD%AEclash">我的笔记</a>）</li>
<li>ios 需要 shadowrocket</li>
</ul>
</li>
</ul>
<h3 id="02-git--github">0.2 git &amp; github</h3>
<ol>
<li>
<p>学习</p>
<ul>
<li>b 站教程（大多都讲的比较浅）</li>
<li><a href="https://git-scm.com/book/zh/v2">《pro git book 2》</a>（不是官方文档，但是 git 官方推荐这本书）</li>
<li><a href="https://zhuanlan.zhihu.com/p/131615378">我的 git 学习笔记</a>（一些排错）</li>
</ul>
</li>
<li>
<p><a href="https://git-scm.com/downloads/guis">图形化工具</a>：可以不敲命令完成 git 操作。</p>
<p><a href="https://github.com/jesseduffield/lazygit.git">lazygit 项目主页</a> &lt;-&gt; <a href="https://www.bilibili.com/video/BV1gV411k7fC">b 站视频介绍</a></p>
</li>
<li>
<p><a href="https://github.com/ysl2/my-notes/blob/master/linux/distribution/manjaro/04-github-download-mirror.md">镜像站</a>：解决国内克隆速度慢的问题</p>
</li>
</ol>
<h2 id="1-linux">1. linux</h2>
<h3 id="11-%E5%AD%A6%E4%B9%A0">1.1 学习</h3>
<ol>
<li>
<p>环境</p>
<blockquote>
<p>在以下三种方式选择一种。mac 内核是 unix，和 linux 区别不大。</p>
</blockquote>
<ul>
<li>虚拟机安装 linux（<a href="https://github.com/ysl2/my-notes/blob/master/virtual-machine/virtual-linux/02-01-VirtualBox-and-Linux.md">virtualbox</a> 或 <a href="https://github.com/ysl2/my-notes/blob/master/virtual-machine/virtual-linux/02-02-VMWare-and-Linux.md">vmware</a>）</li>
<li>windows 下，使用 linux 子系统 2（WSL2）</li>
<li>linux 真机（下文 1.2）</li>
</ul>
</li>
<li>
<p>书</p>
<p>入门：</p>
<ul>
<li>《快乐的 Linux 命令行》（<a href="https://github.com/billie66/TLCL">社区翻译版在这</a>）</li>
<li><a href="https://www.gnu.org/software/bash/manual">《Bash Reference Manual》</a>（bash 官方手册。这本作为工具书备查）</li>
</ul>
<p>进阶：</p>
<ul>
<li><a href="http://linux.vbird.org/">《鸟哥的Linux私房菜》</a></li>
</ul>
</li>
</ol>
<h3 id="12-%E5%BA%94%E7%94%A8">1.2 应用</h3>
<ol>
<li>
<p>发行版选择</p>
<table>
<thead>
<tr>
<th style="text-align:center">发行版</th>
<th style="text-align:left">特点</th>
<th style="text-align:left">包管理器</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>centos</code></td>
<td style="text-align:left">适合服务器，更新策略稳定。但官方团队即将放弃更新。一部分包需要自己编译。</td>
<td style="text-align:left"><code>rpm</code>和<code>yum</code></td>
</tr>
<tr>
<td style="text-align:center"><code>ubuntu</code></td>
<td style="text-align:left">适合服务器或日常使用。更新策略稳定。一部分包需要自己编译。</td>
<td style="text-align:left"><code>apt</code></td>
</tr>
<tr>
<td style="text-align:center"><code>manjaro</code></td>
<td style="text-align:left">适合日常使用。更新策略激进。大部分包都可以在 community 和 AUR 中找到。小部分需要自己编译。</td>
<td style="text-align:left"><code>pacman</code>和<code>yay</code></td>
</tr>
</tbody>
</table>
</li>
<li>
<p>我的 manjaro 配置</p>
<ul>
<li><a href="https://github.com/ysl2/my-notes/tree/master/linux/distribution/manjaro">安装配置-界面配置-包配置</a>（不同发行版之间的配置方法有差异）</li>
<li>dotfiles 及自动化脚本（基于 GNU stow。我写了<a href="https://github.com/ysl2/stow-helper">一个配合 stow 批量恢复 dotfiles 的 java 脚本</a>。这个说起来比较麻烦，等后续需要的时候我再录一段视频演示）</li>
</ul>
</li>
</ol>
<h2 id="2-python">2. python</h2>
<ol>
<li>
<p>入门</p>
<p><a href="https://www.liaoxuefeng.com/wiki/1016959663602400">《廖雪峰的 python 博客》</a></p>
<p><a href="https://docs.python.org/zh-cn/3/">《python 官方文档》</a>（作为工具书备查）</p>
</li>
<li>
<p>进阶</p>
<p>《python cookbook》（<a href="https://python3-cookbook.readthedocs.io/zh_CN/latest/">社区翻译版</a>）</p>
<p>《流畅的 python》</p>
</li>
</ol>
<h2 id="3-%E5%85%B6%E4%BB%96">3. 其他</h2>
<ol>
<li><a href="https://www.bilibili.com/video/BV14E411J7n2">b站【MIT 公开课】6.NULL 你计算机科学教育中遗失的一学期（完结·中英字幕·机翻）</a>
<ul>
<li><a href="https://missing.csail.mit.edu/">官网</a></li>
<li><a href="https://missing-semester-cn.github.io/">社区翻译的中文网站</a></li>
<li><a href="https://github.com/ysl2/my-notes/tree/master/linux/tutor/mit-missing-course-in-university">笔记</a></li>
</ul>
</li>
<li>b 站 up 主<a href="https://space.bilibili.com/13081489?from=search&amp;seid=4798216554892674728">TheCW</a>，youtuber<a href="https://www.youtube.com/c/LukeSmithxyz">Luke Smith</a></li>
<li><a href="https://github.com/ysl2/my-notes">我的笔记主页</a></li>
<li><a href="https://github.com/jenkinsci/docker">docker</a> &lt;-&gt; <a href="https://github.com/jesseduffield/lazydocker">图形化工具 lazydocker 项目主页</a></li>
</ol>

</body>
</html>
